<div class="container" id="app">



    <div class="row">
        <div class="col-md-12">    
            <ol class="breadcrumb">
                <li>
                    <a href="<?=base_url('main')?>">首页</a>
                </li>
                <li class="active">  </li>
            </ol>
        </div>
    </div>

    <div class="row">



    <div class="col-sm-6">



<div class="panel panel-default">
    <div class="panel-heading">新的任务</div>
    <div class="panel-body">
    <form action="<?=base_url('main/catagory_insect')?>" method="POST" class="form-inline" role="form">
            
            <div class="form-group col-xs-10">
                <input type="text" class="form-control" name="catagory_title" id="catagory_title" placeholder="新的Catagory..." style="width:100%">
            </div>
        
        
            <div class="col-xs-2">
                <button type="submit" class="btn btn-primary">Submit</button>
            </div>
    </form>
    </div>
</div>





<div class="panel panel-default">
    <div class="panel-heading">任务清单</div>
    <div class="panel-body">
    <p>正在进行</p>
        <ul>
            <?php foreach($catagory_sidebar['1'] as $catagory_key => $catagory_value){ ?>
                <li>
                    <a href="<?=base_url('main/catagory/') . $catagory_value["catagory_id"]?>"><?=$catagory_value["catagory_date"]?>-<?=$catagory_value["catagory_title"]?></a>
                    <a href="<?=base_url('main/catagory_edit/') . $catagory_value["catagory_id"]?>">#</a>
                    <?php if($catagory_value["catagory_task"] != ''){echo '<pre>' . $catagory_value["catagory_task"] . '</pre>' ;}?>
                </li>
            <?php } ?>
        </ul>

        <p>正在等待</p>
        <ul>
            <?php foreach($catagory_sidebar['2'] as $catagory_key => $catagory_value){ ?>
                <li><a href="<?=base_url('main/catagory/') . $catagory_value["catagory_id"]?>"><?=$catagory_value["catagory_date"]?>-<?=$catagory_value["catagory_title"]?></a>
                <br><?php if($catagory_value["catagory_task"] != ''){echo '<pre>' . $catagory_value["catagory_task"] . '</pre>' ;}?>
                </li>
            <?php } ?>
        </ul>


        <p>长期任务</p>
        <ul>
            <?php foreach($catagory_sidebar['3'] as $catagory_key => $catagory_value){ ?>
                <li><a href="<?=base_url('main/catagory/') . $catagory_value["catagory_id"]?>"><?=$catagory_value["catagory_date"]?>-<?=$catagory_value["catagory_title"]?></a>
                <br><?php if($catagory_value["catagory_task"] != ''){echo '<pre>' . $catagory_value["catagory_task"] . '</pre>' ;}?>
            </li>
            <?php } ?>
        </ul>


        <p>已经完成</p>
        <ul>
            <?php foreach($catagory_sidebar['0'] as $catagory_key => $catagory_value){ ?>
                <li><a href="<?=base_url('main/catagory/') . $catagory_value["catagory_id"]?>"><?=$catagory_value["catagory_date"]?>-<?=$catagory_value["catagory_title"]?></a>
                <br><?php if($catagory_value["catagory_task"] != ''){echo '<pre>' . $catagory_value["catagory_task"] . '</pre>' ;}?>
            </li>
            <?php } ?>
        </ul>
    </div>
</div>












    </div><!-- col-sm-6 -->





        <div class="col-sm-6">






<!-- ===================================
POST
=================================== -->

<?php foreach($posts as $post_key => $post_value){ ?>


<div class="panel panel-default">
    <div class="panel-heading">
            <h3 class="panel-title">
                <span class="pull-right"><a href="<?=base_url('main/post/') . $post_value['posts_catagory'] . '/' . $post_value['posts_id']?>" class="btn btn-xs btn-default">[编辑]</a></span>
                liyi，<?=$post_value["posts_ctime"]?>，<?=$post_value["posts_update"]?>
            </h3>
    </div>
    <div class="panel-body">
            <p><pre><?=$post_value["posts_content"]?></pre></p>

            <ul>
                <?php foreach($post_value["posts_files_array"] as $file_key => $file_info){ ?>
                    <li>
                        <a target="_blank" href="<?=base_url('/uploads/') . $post_value['posts_catagory'] . '/' . $file_info["file_newname"]?>">
                            <?=$file_info["file_oldname"]?>
                            (<?=$file_info["file_size"]?>MB)
                        </a>
                    </li>

                <?php }?>

            </ul>

            <div class="pull-right">
                <span class="glyphicon glyphicon-folder-close" aria-hidden="true"></span> <?=$post_value["posts_catagory_title"]?>
            </div>


            <?php
                if(is_array($post_value["posts_tags_array"])){
                    foreach($post_value["posts_tags_array"] as $tag_key => $tag_value){  
            ?>
                <a href="<?=base_url('main/tag/') . $tag_value['tag_id']?>" class="btn btn-xs btn-default">#<?=$tag_value['tag_title']?></a>
            <?php
                    }//foreach
                }else{
                    echo '';
                } 
            ?>

    </div>
</div>


<?php } ?>






        </div><!--col-sm-6 -->
    </div>


</div><!-- .container -->




<script>
    var app = new Vue({
        el:"#app",
        data:{
            msg:"Hello world",
            style_new_post:false,
        },
        methods:{
            toggle_new_post(){
                this.style_new_post = !this.style_new_post;
            },
        }
    })
</script>
